

#include "SimpleRtsp\lhpSimpleRtspClient.h"
#pragma comment(lib, "ws2_32.lib")

using namespace lhpSimpleRtspSC;

void socketResult(bool result, string resultLog){
	printf("%s\n",resultLog.c_str());
} 

int RTSPSourceData(int _chid,void* _chPtr,int _mediatype, char *pbuf,int buf_len){
	printf("recv h264 frame len:%d.\n",buf_len);
	return 0;
}


int main(){

	lhpSimpleRtspClient rtspClient;
	string url="rtsp://192.168.0.135:554/TestSession";
	if (rtspClient.openUrl(0,url,"",socketResult,RTSPSourceData,NULL))
	{
		printf("open %s success.\n",url.c_str());
		while (1)
		{
			Sleep(1000);
		}
	}
	else{
		printf("open %s failed.\n",url.c_str());
	}

	rtspClient.closeUrl();

}


